<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // phone` varchar(11) NOT NULL COMMENT '手机号',
        //  `password` varchar(255) NOT NULL COMMENT '密码',
        //  `icon` varchar(255) NOT NULL COMMENT '头像地址',
        //  `nickname` varchar(255) NOT NULL COMMENT '昵称',
        //  `remarks` varchar(255) NOT NULL COMMENT '用户备注',
        //  `gender` tinyint(1) NOT NULL COMMENT '性别，1：男，2：女',
        //  `birthday` int(11) NOT NULL COMMENT '生日',
        //  `email` varchar(255) NOT NULL COMMENT '邮箱',
        //  `province_id` int(11) NOT NULL COMMENT '省份ID',
        //  `city_id` int(11) NOT NULL COMMENT '城市ID',
        //  `district_id` int(11) NOT NULL COMMENT '区域ID',
        //  `name` varchar(255) NOT NULL COMMENT '真实姓名',
        //  `authentication` tinyint(1) NOT NULL COMMENT '是否认证用户，-1：未认证，1：认证',
        //  `integral` int(11) NOT NULL COMMENT '积分',
        //  `balance` decimal(11,2) NOT NULL COMMENT '余额',
        //  `status` tinyint(1) NOT NULL COMMENT '状态：-1，禁用，1：正常',
        //  `login_time` int(11) NOT NULL COMMENT '登陆时间',

        Schema::dropIfExists('user');
        Schema::create('user', function (Blueprint $table) {
            $table->id();

            $table->string("phone")->comment("手机号");
            $table->string('password')->comment("密码");
            $table->string("icon")->comment("头像地址");
            $table->string('nickname')->comment("昵称");
            $table->string('remark')->comment("用户备注");
            $table->tinyInteger('gender')->comment("性别");
            $table->integer('birthday')->comment("生日");
            $table->string('email')->comment("邮箱");
            $table->integer('province_id')->comment("省份");
            $table->integer('city_id')->comment("城市");
            $table->integer('district_id')->comment("区域");
            $table->string('name')->comment("真实姓名");
            $table->tinyInteger("authentication")->comment("是否认证");
            $table->integer('integral')->comment("积分");
            $table->decimal("balance")->comment("余额");
            $table->tinyInteger('status')->comment("状态");
            $table->integer('login_time')->comment("登录时间");

            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
            //$table->timestamp('email_verified_at')->nullable();

            $table->rememberToken();
            #$table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
